<?php

/**
 * Created by PhpStorm.
 * User: yangsen
 * Date: 15/7/7
 * Time: 下午3:01
 */
 class HourTask extends MY_Controller {

    public function __construct() {
        parent::__construct();
    }


    public function updatePayerCountTask() {

        $sql_for_select_payercount = 'select count(payer_openid) cnt from (select payer_openid from t_payrecord where ctime>'.strtotime('today').' group by payer_openid ) a ';

        $rs = $this->db->query($sql_for_select_payercount)->result_array()[0]['cnt'];

       $this->db->update('t_stat',array('payercnt'=>$rs),array('ctimehour'=>date('YmdH')));
    }
}




